from app import db

class Prompt(db.Model):
    __tablename__ = 'prompts'

    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    prompt = db.Column(db.Text, nullable=False)
    prompt_name = db.Column(db.String(255), nullable=False)

    def __repr__(self):
        return f"<Prompt(id={self.id}, prompt_name='{self.prompt_name}')>"

    def to_dict(self):
        return {
            "id": self.id,
            "prompt": self.prompt,
            "prompt_name": self.prompt_name
        }
